<?php
if(!defined('MID_APP')) exit('Access Denied');
?>
<!-- layout::Admin:iframe/header::$tpl_cache_date -->

<!-- Start Page Header -->
<div id="page-header">
<h1><?=$title?></h1>
</div>
<!-- End Page Header -->

<!-- Start Grid -->
<div class="container_12"><!-- Start Table -->
<div class="grid_12">

<div class="box-header">权限映射</div>
<div class="box table">
<form method="post">
<table cellspacing="0">
	<thead>
		<tr>
			<td class="tl">
				<!-- Accredit Type --><?=$type?>
				<!-- Role --><?=$role?>
				<!-- App --><?=$app?>
				<!-- Model --><?=$model?>
				<!-- Action --><?=$action?>
				<!-- Level --><input type="hidden" name="level" value="<?=$level?>" />
				<!-- Form Action -->
				<input type="image" src="<?=$tplPath?>img/icons/small/save.png" title="保存权限映射" class="va fr" />
			</td>
		</tr>
	</thead>
	<tbody>
      <?php
        foreach($list as $k=>$v){
        ?>
        <tr>
			<td class="tl">
				<?=$v?>
			</td>
		</tr>
      <?php } ?>
      </tbody>
</table>
</form>
</div>
<!-- End Table -->
</div>
</div>

<script>
$("select").change(function(){
    if(-1 == this.value){
		return false;
	} else {
		var url = location.href
		location.href = url.changeQuery(this.name, this.value);
	}
});

/**
 * 更改 URL 参数
 *
 * @param String 名称
 * @param String 值
 */
String.prototype.changeQuery = function(name,value) {
	var reg = new RegExp("(^|)"+ name +"=([^&]*)(|$)");
	var tmp = name + "=" + value;
	if(this.match(reg) != null) {
		return this.replace(eval(reg),tmp);
	} else {
		if(this.match("[\?]")) {
			return this + "&" + tmp;
		} else {
			return this + "?" + tmp;
		}
	}
 }
</script>

<!-- layout::Admin:iframe/footer::$tpl_cache_date -->